<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/10/17 0017
  Time: 上午 10:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>编辑</title>
    <link rel="stylesheet" href="/static/js/plugins/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/common.css">

</head>
<body>
<div class="box-border">
    <form action="/update" method="post"class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">权限名称</label>
            <div class="layui-input-block">
                <input type="hidden" name="id" value="${premission.id}">
                <input type="text" name="name" value="${premission.name}" lay-verify="required" placeholder="请输入权限名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">权限类型</label>
            <div class="layui-input-block">
                <select name="type"  lay-verify="required" lay-filter="type">
                    <option value="1" <c:if test="${premission.type eq 1}">selected </c:if>>模块</option>
                    <option value="2" <c:if test="${premission.type eq 2}">selected </c:if>>功能</option>
                    <option value="3" <c:if test="${premission.type eq 3}">selected </c:if>>按钮</option>
                    <option value="4" <c:if test="${premission.type eq 4}">selected </c:if>>附属操作</option>
                    <option value="9" <c:if test="${premission.type eq 9}">selected </c:if>>默认权限</option>
                </select>
            </div>
        </div>
        <div id="mstyle" class="layui-form-item <c:if test="${premission.type eq 1 ||premission.type eq 9}">layui-hide</c:if>" >
            <label class="layui-form-label">父级权限</label>
            <div class="layui-input-block">
                <select name="parentsId"  id="module"  >
                    <c:forEach items="${premiType}" var="premi">
                        <option value="${premi.id}" <c:if test="${premi.id eq premission.parentsId}"> selected</c:if> >${premi.name}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div id="utyle" class="layui-form-item <c:if test="${premission.type eq 1 }">layui-hide</c:if>">
            <label class="layui-form-label">URI</label>
            <div class="layui-input-block">
                <input type="text" name="url" value="${premission.url}"  placeholder="请输入URl" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div id="btnId" class="layui-form-item <c:if test="${premission.type != 3}">layui-hide</c:if> ">
            <label class="layui-form-label">按钮Id</label>
            <div class="layui-input-block">
                <input type="text" name="buttonId" value="${premission.buttonId}"  placeholder="请输入按钮ID" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="text" name="sortNo"  value="${premission.sortNo}"  lay-verify="required" placeholder="请输入排序" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formSubmit">保存</button>
                <a href="/list"> <button type="button" class="layui-btn layui-btn-primary">取消</button></a>
            </div>
        </div>
    </form>
</div>

<script src="/static/js/plugins/jquery.js"></script>
<script src="/static/js/plugins/layui/layui.js"></script>
<script src="/static/js/edit.js"></script>
</body>
</html>
